2828if TYPE_CHECKING :
2929 from animatedledstrip .animation_info import AnimationInfo
3030 from animatedledstrip .animation_to_run_params import AnimationToRunParams
31+ from animatedledstrip .new_animation_group_info import NewAnimationGroupInfo
3132 from animatedledstrip .running_animation_params import RunningAnimationParams
3233 from animatedledstrip .section import Section
3334 from animatedledstrip .strip_info import StripInfo
@@ -58,9 +59,6 @@ def _delete_data(self, url: str) -> Any:
5859 def get_animation_info (self , anim_name : str ) -> 'AnimationInfo' :
5960 return self .decoder .decode_object_with_type (self ._get_data ('/animation/' + anim_name ), 'AnimationInfo' )
6061
61- def get_supported_animations_names (self ) -> List [str ]:
62- return json .loads (self ._get_data ('/animations/names' ))
63-
6462 def get_supported_animations (self ) -> List ['AnimationInfo' ]:
6563 return self .decoder .decode_list_with_type (self ._get_data ('/animations' ), 'AnimationInfo' )
6664
@@ -70,6 +68,12 @@ def get_supported_animations_map(self) -> Dict[str, 'AnimationInfo']:
7068 def get_supported_animations_dict (self ) -> Dict [str , 'AnimationInfo' ]:
7169 return self .get_supported_animations_map ()
7270
71+ def get_supported_animations_names (self ) -> List [str ]:
72+ return json .loads (self ._get_data ('/animations/names' ))
73+
74+ def create_new_group (self , new_group : 'NewAnimationGroupInfo' ):
75+ return self .decoder .decode_object_with_type (self ._post_data ('/animations/newGroup' , new_group ), 'AnimationInfo' )
76+
7377 def get_running_animations (self ) -> Dict [str , 'RunningAnimationParams' ]:
7478 return self .decoder .decode_map_with_type (self ._get_data ('/running' ), 'RunningAnimationParams' )
7579
@@ -82,36 +86,36 @@ def get_running_animation_params(self, anim_id: str) -> 'RunningAnimationParams'
8286 def end_animation (self , anim_id : str ) -> 'RunningAnimationParams' :
8387 return self .decoder .decode_object_with_type (self ._delete_data ('/running/' + anim_id ), 'RunningAnimationParams' )
8488
85- def end_animation_from_params (self , anim_params : 'RunningAnimationParams' ) -> 'RunningAnimationParams ' :
86- return self .end_animation ( anim_params . anim_id )
89+ def get_section (self , section_name : str ) -> 'Section ' :
90+ return self .decoder . decode_object_with_type ( self . _get_data ( '/sections/' + section_name ), 'Section' )
8791
8892 def get_sections (self ) -> List ['Section' ]:
8993 return self .decoder .decode_list_with_type (self ._get_data ('/sections' ), 'Section' )
9094
95+ def create_new_section (self , new_section : 'Section' ) -> 'Section' :
96+ return self .decoder .decode_object_with_type (self ._post_data ('/sections' , new_section ), 'Section' )
97+
9198 def get_sections_map (self ) -> Dict [str , 'Section' ]:
9299 return self .decoder .decode_map_with_type (self ._get_data ('/sections/map' ), 'Section' )
93100
94101 def get_sections_dict (self ) -> Dict [str , 'Section' ]:
95102 return self .get_sections_map ()
96103
97- def get_section (self , section_name : str ) -> 'Section' :
98- return self .decoder .decode_object_with_type (self ._get_data ('/sections/' + section_name ), 'Section' )
99-
100- def get_full_strip_section (self ) -> 'Section' :
101- return self .get_section ('fullStrip' )
102-
103- def create_new_section (self , new_section : 'Section' ) -> 'Section' :
104- return self .decoder .decode_object_with_type (self ._post_data ('/sections' , new_section ), 'Section' )
105-
106104 def start_animation (self , anim_params : 'AnimationToRunParams' ) -> 'RunningAnimationParams' :
107105 return self .decoder .decode_object_with_type (self ._post_data ('/start' , anim_params ), 'RunningAnimationParams' )
108106
109- def get_strip_info (self ) -> 'StripInfo' :
110- return self .decoder .decode_object_with_type (self ._get_data ('/strip/info' ), 'StripInfo' )
107+ def clear_strip (self ):
108+ # TODO: Fix 404
109+ self ._post_data ('/strip/clear' , None )
111110
112111 def get_current_strip_color (self ) -> List [int ]:
113112 return json .loads (self ._get_data ('/strip/color' ))
114113
115- def clear_strip (self ):
116- # TODO: Fix 404
117- self ._post_data ('/strip/clear' , None )
114+ def get_strip_info (self ) -> 'StripInfo' :
115+ return self .decoder .decode_object_with_type (self ._get_data ('/strip/info' ), 'StripInfo' )
116+
117+ def end_animation_from_params (self , anim_params : 'RunningAnimationParams' ) -> 'RunningAnimationParams' :
118+ return self .end_animation (anim_params .anim_id )
119+
120+ def get_full_strip_section (self ) -> 'Section' :
121+ return self .get_section ('fullStrip' )
0 commit comments