Resolves #493 Send media_player calls even if it if unavailable
This commit is contained in:
		| @@ -118,23 +118,19 @@ class MediaPlayerPlaybackControls extends StatelessWidget { | |||||||
|  |  | ||||||
|  |  | ||||||
|   void _setPower(MediaPlayerEntity entity) { |   void _setPower(MediaPlayerEntity entity) { | ||||||
|     if (entity.state != EntityState.unavailable && entity.state != EntityState.unknown) { |  | ||||||
|       if (entity.state == EntityState.off) { |       if (entity.state == EntityState.off) { | ||||||
|         Logger.d("${entity.entityId} turn_on"); |  | ||||||
|         ConnectionManager().callService( |         ConnectionManager().callService( | ||||||
|             domain: entity.domain, |             domain: entity.domain, | ||||||
|             service: "turn_on", |             service: "turn_on", | ||||||
|             entityId: entity.entityId |             entityId: entity.entityId | ||||||
|           ); |           ); | ||||||
|       } else { |       } else { | ||||||
|         Logger.d("${entity.entityId} turn_off"); |  | ||||||
|         ConnectionManager().callService( |         ConnectionManager().callService( | ||||||
|             domain: entity.domain, |             domain: entity.domain, | ||||||
|             service: "turn_off", |             service: "turn_off", | ||||||
|             entityId: entity.entityId |             entityId: entity.entityId | ||||||
|           ); |           ); | ||||||
|       } |       } | ||||||
|     } |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   void _callAction(MediaPlayerEntity entity, String action) { |   void _callAction(MediaPlayerEntity entity, String action) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user