File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -110,22 +110,25 @@ def _get_moc_data(self):
110110 is_started = False
111111 return is_started , data
112112
113+ def _organize_data (self , data ):
114+ temporary = {}
115+ for line in data .splitlines ():
116+ category , value = line .split (": " , 1 )
117+ temporary [category .lower ()] = value
118+ return temporary
119+
113120 def moc (self ):
114121 is_paused = is_playing = is_stopped = None
115122 cached_until = self .sleep_timeout
116123 color = self .py3 .COLOR_BAD
117- data = {}
118124
119125 is_started , moc_data = self ._get_moc_data ()
120126
121127 if is_started :
122128 cached_until = self .cache_timeout
129+ moc_data = self ._organize_data (moc_data )
123130
124- for line in moc_data .splitlines ():
125- category , value = line .split (": " , 1 )
126- data [category .lower ()] = value
127-
128- self .state = data ["state" ]
131+ self .state = moc_data ["state" ]
129132 if self .state == "PLAY" :
130133 is_playing = True
131134 color = self .color_playing
You can’t perform that action at this time.
0 commit comments