def update_minion_blocks(self, dt):
# Note: Sections were originally named "blocks", so far I've been too lazy to rewrite all the cedarserver code to reflect the new name. -IHS
start_length = len(self.sections)
block_delta = len(self.minion['settings']['blocks']) - start_length
if block_delta > 0:
for n in range(block_delta):
config = self.minion['settings']['blocks'][start_length + n]
section = Section(
source = self.source,
block = config,
client = self
)
self.layout.add_widget(section)
self.sections.append(section)
elif block_delta < 0:
for n in range(abs(block_delta)):
section = self.sections.pop()
self.layout.remove_widget(section)
for index, section in enumerate(self.sections):
config = self.minion['settings']['blocks'][index]
if not section.block == config: # TODO add brightness etc.
section.block = config
section.recalc()
评论列表
文章目录