"ALL ON" and "ALL OFF" switches

This commit is contained in:
Charles Magahern
2015-12-31 18:20:50 -08:00
parent 4df09f18c5
commit e85e9173e5
5 changed files with 189 additions and 74 deletions
@@ -103,7 +103,7 @@ class MainViewController: UIViewController, SwitchesViewControllerDelegate {
// MARK: SwitchesViewControllerDelegate
func switchesViewControllerDidToggleDevice(controller: SwitchesViewController, device: WemoDevice)
func switchesViewControllerDidToggleDevices(controller: SwitchesViewController, devices: [WemoDevice])
{
_updateVisualization(true)
}
@@ -120,6 +120,8 @@ class MainViewController: UIViewController, SwitchesViewControllerDelegate {
}
let percentageActivated = Float(activatedDevicesCount) / Float(self.devices.count)
_visualizationController.setPercentActivated(percentageActivated, animated: animated)
if (percentageActivated != _visualizationController.percentActivated) {
_visualizationController.setPercentActivated(percentageActivated, animated: animated)
}
}
}