platypush/plugins/switchbot/__init__.py
def devices(self) -> List[dict]:
        """
        Get the list of devices associated to the specified Switchbot API account.

        :return: .. schema:: switchbot.DeviceSchema(many=True)
        """
        devices = self._run('get', 'devices')
        devices = [
            DeviceSchema().dump({
                **device,
                'is_virtual': False,
            })
            for device in devices.get('deviceList', [])
        ] + [
            DeviceSchema().dump({
                **device,
                'is_virtual': True,
            })
            for device in devices.get('infraredRemoteList', [])
        ]

        for device in devices:
            self._devices_by_id[device['id']] = device
            self._devices_by_name[device['name']] = device

        return devices

        Get the list of devices associated to the specified Switchbot API account.

        :return: .. schema:: switchbot.DeviceSchema(many=True)
        
Get the list of devices associated to the specified Switchbot API account.
Get the list of devices associated to the specified Switchbot API account .
def devices(self) -> List[dict]:
        devices = self._run('get', 'devices')
        devices = [
            DeviceSchema().dump({
                **device,
                'is_virtual': False,
            })
            for device in devices.get('deviceList', [])
        ] + [
            DeviceSchema().dump({
                **device,
                'is_virtual': True,
            })
            for device in devices.get('infraredRemoteList', [])
        ]
        for device in devices:
            self._devices_by_id[device['id']] = device
            self._devices_by_name[device['name']] = device
        return devices
def devices ( self ) -> List [ dict ] : devices = self . _run ( 'get' , 'devices' ) devices = [ DeviceSchema ( ) . dump ( { ** device , 'is_virtual' : False , } ) for device in devices . get ( 'deviceList' , [ ] ) ] + [ DeviceSchema ( ) . dump ( { ** device , 'is_virtual' : True , } ) for device in devices . get ( 'infraredRemoteList' , [ ] ) ] for device in devices : self . _devices_by_id [ device [ 'id' ] ] = device self . _devices_by_name [ device [ 'name' ] ] = device return devices
Get the list of devices associated to the specified Switchbot API account.
Get the list of devices associated to the specified Switchbot API account .
"""
        Get the list of devices associated to the specified Switchbot API account.

        :return: .. schema:: switchbot.DeviceSchema(many=True)
        """
None
self