去掉老床垫相关功能

This commit is contained in:
fuenmao
2026-11-09 16:10:05 +08:00
parent 2d44cc3966
commit 3ca90c4cf3
25 changed files with 227 additions and 466 deletions
@@ -30,7 +30,7 @@ public sealed class HealthHomeAssistantService : IDynamicApiController, ITransie
private readonly HomeAssistantOptions _options;
private readonly SqlSugarRepository<HealthSceneExecution> _executionRepository;
private readonly SqlSugarRepository<HealthProfile> _profileRepository;
private readonly MattressComfortService _mattressComfort;
private readonly EnvironmentAdviceService _environmentAdvice;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly DeviceModuleRegistry _modules;
private readonly DeviceParameterController _parameters;
@@ -46,7 +46,7 @@ public sealed class HealthHomeAssistantService : IDynamicApiController, ITransie
IOptions<HomeAssistantOptions> options,
SqlSugarRepository<HealthSceneExecution> executionRepository,
SqlSugarRepository<HealthProfile> profileRepository,
MattressComfortService mattressComfort,
EnvironmentAdviceService environmentAdvice,
IHttpContextAccessor httpContextAccessor,
DeviceModuleRegistry modules,
DeviceParameterController parameters,
@@ -61,7 +61,7 @@ public sealed class HealthHomeAssistantService : IDynamicApiController, ITransie
_options = options.Value;
_executionRepository = executionRepository;
_profileRepository = profileRepository;
_mattressComfort = mattressComfort;
_environmentAdvice = environmentAdvice;
_httpContextAccessor = httpContextAccessor;
_modules = modules;
_parameters = parameters;
@@ -128,8 +128,8 @@ public sealed class HealthHomeAssistantService : IDynamicApiController, ITransie
{
constitutionCode = tcmResult.ConstitutionCode;
userConfig = tcmResult.SceneConfig;
var comfort = _mattressComfort.Get(profile, stateMap);
MattressComfortService.ApplyTo(userConfig, comfort);
var comfort = _environmentAdvice.Get(profile, stateMap);
EnvironmentAdviceService.ApplyTo(userConfig, comfort);
}
}
catch (Exception exception) when (exception is not OperationCanceledException)
@@ -340,8 +340,8 @@ public sealed class HealthHomeAssistantService : IDynamicApiController, ITransie
if (!tcmResult.HasCompleted)
throw new ScenePreparationException("请先完成中医四诊,生成体质倾向后再一键启动");
var config = tcmResult.SceneConfig;
var mattressComfort = await _mattressComfort.GetAsync(profile, token);
MattressComfortService.ApplyTo(config, mattressComfort);
var environmentAdvice = await _environmentAdvice.GetAsync(profile, token);
EnvironmentAdviceService.ApplyTo(config, environmentAdvice);
RoomTemperaturePolicy.PickTargetForSession(config.ClimateAdvice);
return new PreparedSleepScene(config, tcmResult.ConstitutionCode);
});