Compare commits
	
		
			2 Commits
		
	
	
		
			17eafdee41
			...
			6b0f0d21fe
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6b0f0d21fe | |||
| d5b5db07ad | 
@ -48,7 +48,7 @@ class PlejdLight(LightEntity, CoordinatorEntity):
 | 
				
			|||||||
            "identifiers": {(DOMAIN, self.device.BLE_address)},
 | 
					            "identifiers": {(DOMAIN, self.device.BLE_address)},
 | 
				
			||||||
            "name": self.device.name,
 | 
					            "name": self.device.name,
 | 
				
			||||||
            "manufacturer": "Plejd",
 | 
					            "manufacturer": "Plejd",
 | 
				
			||||||
            "model": self.device.model,
 | 
					            "model": f"{self.device.model} ({self.device.hardwareId})",
 | 
				
			||||||
            #"connections": ???,
 | 
					            #"connections": ???,
 | 
				
			||||||
            "suggested_area": self.device.room,
 | 
					            "suggested_area": self.device.room,
 | 
				
			||||||
            "sw_version": self.device.firmware,
 | 
					            "sw_version": self.device.firmware,
 | 
				
			||||||
 | 
				
			|||||||
@ -103,6 +103,8 @@ class PlejdMesh():
 | 
				
			|||||||
        await client.start_notify(PLEJD_LASTDATA, _lastdata)
 | 
					        await client.start_notify(PLEJD_LASTDATA, _lastdata)
 | 
				
			||||||
        await client.start_notify(PLEJD_LIGHTLEVEL, _lightlevel)
 | 
					        await client.start_notify(PLEJD_LIGHTLEVEL, _lightlevel)
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        await self.poll()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return True
 | 
					        return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async def write(self, payload):
 | 
					    async def write(self, payload):
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,7 @@ LIGHT = "light"
 | 
				
			|||||||
SENSOR = "sensor"
 | 
					SENSOR = "sensor"
 | 
				
			||||||
SWITCH = "switch"
 | 
					SWITCH = "switch"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HARDWARE_TYPES = {
 | 
					HARDWARE_TYPES = {
 | 
				
			||||||
    "0": Device("-unknown-", LIGHT, False),
 | 
					    "0": Device("-unknown-", LIGHT, False),
 | 
				
			||||||
    "1": Device("DIM-01", LIGHT, True),
 | 
					    "1": Device("DIM-01", LIGHT, True),
 | 
				
			||||||
@ -17,13 +18,13 @@ HARDWARE_TYPES = {
 | 
				
			|||||||
    "5": Device("LED-10", LIGHT, True),
 | 
					    "5": Device("LED-10", LIGHT, True),
 | 
				
			||||||
    "6": Device("WPH-01", SWITCH, False),
 | 
					    "6": Device("WPH-01", SWITCH, False),
 | 
				
			||||||
    "7": Device("REL-01", SWITCH, False),
 | 
					    "7": Device("REL-01", SWITCH, False),
 | 
				
			||||||
    "8": Device("-unknown-", LIGHT, False),
 | 
					    "8": Device("SPR-01?", SWITCH, False),
 | 
				
			||||||
    "9": Device("-unknown-", LIGHT, False),
 | 
					    "9": Device("-unknown-", LIGHT, False),
 | 
				
			||||||
    "10": Device("-unknown-", LIGHT, False),
 | 
					    "10": Device("WRT-01", SWITCH, False),
 | 
				
			||||||
    "11": Device("DIM-01", LIGHT, True),
 | 
					    "11": Device("DIM-01", LIGHT, True),
 | 
				
			||||||
    "12": Device("-unknown-", LIGHT, False),
 | 
					    "12": Device("-unknown-", LIGHT, False),
 | 
				
			||||||
    "13": Device("Generic", LIGHT, False),
 | 
					    "13": Device("Generic", LIGHT, False),
 | 
				
			||||||
    "14": Device("-unknown-", LIGHT, False),
 | 
					    "14": Device("DIM-01", LIGHT, True),
 | 
				
			||||||
    "15": Device("-unknown-", LIGHT, False),
 | 
					    "15": Device("-unknown-", LIGHT, False),
 | 
				
			||||||
    "16": Device("-unknown-", LIGHT, False),
 | 
					    "16": Device("-unknown-", LIGHT, False),
 | 
				
			||||||
    "17": Device("REL-01", SWITCH, False),
 | 
					    "17": Device("REL-01", SWITCH, False),
 | 
				
			||||||
@ -66,6 +67,9 @@ class PlejdDevice:
 | 
				
			|||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def firmware(self):
 | 
					    def firmware(self):
 | 
				
			||||||
        return self.data["firmware"]
 | 
					        return self.data["firmware"]
 | 
				
			||||||
 | 
					    @property
 | 
				
			||||||
 | 
					    def hardwareId(self):
 | 
				
			||||||
 | 
					        return self.data["hardwareId"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def type(self):
 | 
					    def type(self):
 | 
				
			||||||
 | 
				
			|||||||
@ -48,7 +48,7 @@ class PlejdSwitch(SwitchEntity, CoordinatorEntity):
 | 
				
			|||||||
            "identifiers": {(DOMAIN, self.device.BLE_address)},
 | 
					            "identifiers": {(DOMAIN, self.device.BLE_address)},
 | 
				
			||||||
            "name": self.device.name,
 | 
					            "name": self.device.name,
 | 
				
			||||||
            "manufacturer": "Plejd",
 | 
					            "manufacturer": "Plejd",
 | 
				
			||||||
            "model": self.device.model,
 | 
					            "model": f"{self.device.model} ({self.device.hardwareId})",
 | 
				
			||||||
            #"connections": ???,
 | 
					            #"connections": ???,
 | 
				
			||||||
            "suggested_area": self.device.room,
 | 
					            "suggested_area": self.device.room,
 | 
				
			||||||
            "sw_version": self.device.firmware,
 | 
					            "sw_version": self.device.firmware,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user