emnify.modules.device.manager ============================= .. py:module:: emnify.modules.device.manager Classes ------- .. autoapisummary:: emnify.modules.device.manager.DeviceManager Module Contents --------------- .. py:class:: DeviceManager(client) Manager that allows to get/retrieve/create/update/send_sms to device Args: client: An instance of the EMnify class used for making API requests. .. py:attribute:: client .. py:property:: device_model .. py:property:: list_sms_model .. py:property:: device_detailed_model .. py:property:: sms_create_model .. py:property:: event_model .. py:property:: status_model .. py:property:: device_create_model .. py:property:: device_update_model .. py:property:: service_profile_model .. py:property:: tariff_profile_model .. py:property:: get_device_sort_enum .. py:property:: get_device_filter_model :type: Type[emnify.modules.device.models.FilterDeviceModel] .. py:method:: get_device_sms_list(*, device: Union[emnify.modules.device.models.Device, int]) -> emnify.modules.device.models.ListSms Returns a list of SMS from the device. :param device: device model or id of device :return: list of devices .. py:method:: send_sms(*, device: Union[emnify.modules.device.models.Device, int, emnify.modules.device.models.RetrieveDevice], sms: emnify.modules.device.models.SmsCreateModel) -> bool Sends an SMS to the device. :param device: device model or id of device :param sms: SmsCreateModel :return: True if sms was sent .. py:method:: update_device(*, device_id: int, device: emnify.modules.device.models.UpdateDevice) -> emnify.modules.device.models.Device Updates the device. :param device_id: id of device :param device: device update model :return: True if device was updated .. py:method:: reset_connectivity_network(device_id: int) -> True Resets the device's connectivity network. :param device_id: id of device :return: True if reset of network was successful .. py:method:: reset_connectivity_data(device_id: int) -> True Resets the device's connectivity data. :param device_id: id of device :return: True if reset of data was successful .. py:method:: get_device_connectivity_status(device_id: int) -> emnify.modules.device.models.DeviceConnectivityStatus Returns the device's connectivity status. :param device_id: id of device :return: DeviceConnectivityStatus model .. py:method:: get_devices_list(*args, filter_model: emnify.modules.device.models.FilterDeviceModel = None, sort_enum: emnify.modules.device.models.DeviceSortModel = None, **kwargs) -> Generator[emnify.modules.device.models.Device, None, None] Returns a list of devices. :param filter_model: device filter model :param sort_enum: device sort enum :return: list of devices .. py:method:: delete_device(device_id: int) -> True Deletes the device. :param device_id: id of device :return: True if device was deleted .. py:method:: add_device_blacklist_operator(device_id: int, operator_id: int) -> True Adds an operator to the blacklist. :param device_id: id of device :param operator_id: id of operator :return: True if operator was added to blacklist .. py:method:: delete_device_blacklist_operator(device_id: int, operator_id: int) Removes an operator from the blacklist. :param device_id: id of device :param operator_id: id of operator :return: True if operator was deleted from blacklist .. py:method:: get_device_operator_blacklist(device_id: int) Returns a list of blacklisted operators. :param device_id: id of device :return: list of operators .. py:method:: get_device_events_list(device: Union[emnify.modules.device.models.Device, int]) Returns a list of events for the device. :param device: Device pydantic-model or int :return: Generator with Device objects .. py:method:: change_status(device: Union[emnify.modules.device.models.UpdateDevice, emnify.modules.device.models.Device, emnify.modules.device.models.RetrieveDevice, int], enable: bool = None, disable: bool = None) -> bool Changes the status of a device and its assigned SIM to enabled or disabled. :param device: The ID or device model to update. :param enable: Whether to enable the device. :param disable: Whether to disable the device. :raises ValidationErrorException: If neither `enable` nor `disable` is provided, or if both are provided. .. py:method:: disable_device(device_id: int) Changes a device status to 'disabled'. :param device_id: id of device :return: True if device was disabled .. py:method:: release_sim(device_id: int) Releases the assigned SIM from the device. :param device_id: id of device :return: True if sim was released .. py:method:: assign_sim(device_id: int, sim_id: int, enable: bool = False) -> None Assigns a SIM to the device :param device_id: id of device :param sim_id: id of SIM :param enable: boolean value/activate to enable or disable the device .. py:method:: create_device(device: emnify.modules.device.models.Device) -> bool Creates a device :param device: device model :return: True if device was created .. py:method:: retrieve_device(device_id: int) -> emnify.modules.device.models.RetrieveDevice Retrieves endpoint details for a given ID. :param device_id: id of the device. :return: Endpoint details associated with the given ID. .. py:method:: validate_device(device: emnify.modules.device.models.Device) -> int :staticmethod: .. py:method:: __check_device_status(device, status: dict) :staticmethod: .. py:method:: __change_device_status(action: str, device) .. py:method:: __transform_all_devices_filter_params(filter_model: emnify.modules.device.models.FilterDeviceModel = None, sort_enum: emnify.modules.device.models.DeviceSortModel = None) -> dict :staticmethod: