issue-51-telegram code style
This commit is contained in:
		
							parent
							
								
									7bda3de4d9
								
							
						
					
					
						commit
						8dee5edb0d
					
				| @ -50,9 +50,8 @@ class Telegram(object): | |||||||
|         return [d[1] for d in sorted(self._mbus_devices.items(), key=lambda x: x[0])] |         return [d[1] for d in sorted(self._mbus_devices.items(), key=lambda x: x[0])] | ||||||
| 
 | 
 | ||||||
|     def get_mbus_device_by_channel(self, channel_id): |     def get_mbus_device_by_channel(self, channel_id): | ||||||
|         # Check key, because defaultdict would otherwise instantiate an empty MbusDevice |         # Use .get, because defaultdict would otherwise instantiate an empty MbusDevice | ||||||
|         if channel_id in self._mbus_devices: |         return self._mbus_devices.get(channel_id) | ||||||
|             return self._mbus_devices[channel_id] |  | ||||||
| 
 | 
 | ||||||
|     def __getattr__(self, name): |     def __getattr__(self, name): | ||||||
|         """ will only get called for undefined attributes """ |         """ will only get called for undefined attributes """ | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user